home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 47.7z / BS1 part 47 / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 1 of 7)[HD].7z / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 1 of 7)[HD].adf / dd.lzh / texture.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1993-09-30  |  2.0 KB  |  64 lines

  1. /* ARexx - Texture.rexx applies a simple texture to the selected area in IMR/t */
  2.  
  3. /*
  4.  * This is how to do a 'process' operation. Processes are very simple,
  5.  * all you need to do is :
  6.  *       (1) The area selection
  7.  *       (2) Ask the user for any parameters needed
  8.  *       (3) Backup the image to the UNDO buffer
  9.  *       (4) Call the function that applies the change
  10.  *       (5) Redraw the image
  11.  *       (6) Tell Imagemaster R/t the script has finished
  12.  *
  13.  * If you want to do image loaders and savers, see the examples used
  14.  * for the PMBC format. There is considerably more involved
  15.  * ARexx logic involved in deciding what to do with the new buffer,
  16.  * allocating the right size (you have to look at the source image
  17.  * to see what that size is!). Anyway, it's still pretty easy.
  18.  *
  19.  * This .REXX file would normally go into the RXPI: assigned directory
  20.  * and the executable into                the CMPI: assigned directory
  21.  * Then you would add a line to CMPI:list.list as follows:
  22.  texture,          "Apply a simple texture",              effect
  23.  
  24.  *
  25.  * Feel free to use our examples as 'boilerplate' for your own work.
  26.  */
  27.  
  28. /* Direct the ARexx commands to Imagemaster R/t */
  29. prtnme = 'IM_Port';
  30. address(prtnme);
  31.  
  32. /* First: the area selection */
  33. 'tofront';
  34. 'messagelow Set the Area Select mode for an area selection to follow';
  35. 'area';
  36.  
  37. /* Second: get the function parameters */
  38. options results;
  39. 'askprop "Change (%)" 50 0 100';
  40. level = result;
  41. options;
  42.  
  43. /* Third: back up to the undo buffer */
  44. 'backuptoundo';
  45.  
  46. /* Forth: actually call the function */
  47. options results;
  48. 'jackin';        /* get the pointer to the Public Interface */
  49. jacker = result;
  50. options;
  51. address command;
  52. 'cmpi:texture '||jacker||' '||level;  /* run the actual operation (See the 'c' code) */
  53. address(prtnme);
  54.  
  55. /* Fifth: redraw the image */
  56. 'tofront';
  57. 'redraw';
  58.  
  59. /* Lastly: if this is to be used in a multi-frame sequence, we must tell */
  60. /*         Imagemaster R/t that we are finished                          */
  61. 'finish';
  62.  
  63. exit 0;
  64.